package demo.json.fastJson;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONField;

/**
 * <pre>
 *     {
 * 	"status_code": "200000",
 * 	"hangup_direction": "用户",
 * 	"callee": "1390000****",
 * 	"ring_time": "2023-03-13 11:18:24",
 * 	"duration": "7",
 * 	"voice_type": "voice",
 * 	"b_duration": 7,
 * 	"originate_time": "2023-03-13 11:18:16",
 * 	"b_ring_time": "2023-03-13 11:18:24",
 * 	"b_start_time": "2023-03-13 11:18:36",
 * 	"b_originate_time": "2023-03-13 11:18:16",
 * 	"end_time": "2023-03-13 11:18:43",
 * 	"call_id": "1**********9^1***********6",
 * 	"start_time": "2023-03-13 11:18:36",
 * 	"caller": "057****11252",
 * 	"b_end_time": "2023-03-13 11:18:43",
 * 	"status_msg": "用户听完语音",
 * 	"out_id": "213d82**************2",
 * 	"toll_type": "DOMESTIC"
 *  }
 * </pre>
 */
public class AliVoiceReport {


    // 呼叫ID。
    @JSONField(name = "call_id")
    private String callId;

    // 通话接通时间，即被叫接起电话时间，未接通则为空
    @JSONField(name = "start_time")
    private String startTime;

    // 通话结束时间
    @JSONField(name = "end_time")
    private String endTime;


    // 通话时长，单位为秒，未接通为0秒。
    private String duration;

    /**
     * <a href="https://help.aliyun.com/zh/vms/developer-reference/call-status-code?spm=a2c4g.11186623.0.i16#concept-g44-flw-fhb">呼叫结果状态码</a>
     */
    @JSONField(name = "status_code")
    private String statusCode;
    // 结果描述
    @JSONField(name = "status_msg")
    private String statusMsg;


    // 扩展字段回传，将调用API时传入的字段返回
    @JSONField(name = "out_id")
    private String outId;

    // 主叫号码
    private String caller;
    // 被叫号码
    private String callee;
    // 通话结束方向,取值：用户\机器
    @JSONField(name = "hangup_direction")
    private String hangupDirection;


    // 通话类型  LOCAL：市话。PROVINCE：省内长途。DOMESTIC：国内长途。INTERNATIONAL：国际长途。
    @JSONField(name = "toll_type")
    private String tollType;


    // 呼叫发起时间，即通话由云通信侧向运营商发起时间。
    @JSONField(name = "originate_time")
    private String originateTime;

    // 被叫响铃时间，即发起外呼后被叫收到请求开始响铃的时间。若被叫未响铃，则该字段为空。
    @JSONField(name = "ring_time")
    private String ringTime;


    // 话单类型。voice：普通话单;asr：asr话单; smart_transfer：智能外呼转接话单。
    @JSONField(name = "voice_type")
    private String voiceType;

    // 扩展码或附加信息
    private String extend;

    ///////////////GETTER/SETTER///////////////


    public String getCallId() {
        return callId;
    }

    public void setCallId(String callId) {
        this.callId = callId;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public String getDuration() {
        return duration;
    }

    public void setDuration(String duration) {
        this.duration = duration;
    }

    public String getStatusCode() {
        return statusCode;
    }

    public void setStatusCode(String statusCode) {
        this.statusCode = statusCode;
    }

    public String getStatusMsg() {
        return statusMsg;
    }

    public void setStatusMsg(String statusMsg) {
        this.statusMsg = statusMsg;
    }

    public String getOutId() {
        return outId;
    }

    public void setOutId(String outId) {
        this.outId = outId;
    }

    public String getCaller() {
        return caller;
    }

    public void setCaller(String caller) {
        this.caller = caller;
    }

    public String getCallee() {
        return callee;
    }

    public void setCallee(String callee) {
        this.callee = callee;
    }

    public String getHangupDirection() {
        return hangupDirection;
    }

    public void setHangupDirection(String hangupDirection) {
        this.hangupDirection = hangupDirection;
    }

    public String getTollType() {
        return tollType;
    }

    public void setTollType(String tollType) {
        this.tollType = tollType;
    }

    public String getOriginateTime() {
        return originateTime;
    }

    public void setOriginateTime(String originateTime) {
        this.originateTime = originateTime;
    }

    public String getRingTime() {
        return ringTime;
    }

    public void setRingTime(String ringTime) {
        this.ringTime = ringTime;
    }

    public String getVoiceType() {
        return voiceType;
    }

    public void setVoiceType(String voiceType) {
        this.voiceType = voiceType;
    }

    public String getExtend() {
        return extend;
    }

    public void setExtend(String extend) {
        this.extend = extend;
    }


    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }
}
